%% Compute likelihood

function [likelihood t y] = computeLikelihood(data, label, Weights, N, D) 
    likelihood = 1;
    y = [];
    
    for i = 1:N
        yn = Sigma(data(i,:)*Weights);
        y = [y yn];
        tn = label(i);
        likelihood_scalar = yn^tn*(1-yn)^(1-tn);
        likelihood = likelihood*likelihood_scalar;
    end
    y = y';
    t = label;
end